<!doctype html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<title>冬奥共享学习</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
		<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
		<script type="text/javascript" src="../../plugin/browerVersion/browerVersion.js"></script>
		<link rel="stylesheet" href="../../plugin/bootstrap/bootstrap.min.css" />
		<link rel="stylesheet" href="../../skin/css/normalize.css" />
		<link rel="stylesheet" href="../../skin/fonts/iconfont.css" />
		<link rel="stylesheet" href="studyTalkEdit.css" />
		<link rel="stylesheet" href="../../skin/css/style.css" />
		<link rel="stylesheet" type="text/css" href="../studyTalk/video5.18.4.js/css/video-js.css" />
		<script type="text/javascript" src="../../plugin/jquery/jquery-1.12.1.js"></script>
		<script type="text/javascript" src="../../plugin/jquery/jquery.form.min.js"></script>
		<script src="../../plugin/bootstrap/bootstrap.min.3.3.5.js" type="text/javascript" charset="utf-8"></script>
		
		<script type="text/javascript" charset="utf-8" src="../../plugin/ueditor/ueditor.config.js"></script>
	    <script type="text/javascript" charset="utf-8" src="../../plugin/ueditor/ueditor.all.js"> </script>
	    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
	    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
	    <script type="text/javascript" charset="utf-8" src="../../plugin/ueditor/lang/zh-cn/zh-cn.js"></script>
	    <script type="text/javascript" src="../../../common/klxlearning/slide.js"></script>
	    <script type="text/javascript" src="../../plugin/hivelearncommon.js"></script>
	    <script src="../studyTalk/video5.18.4.js/js/video.min.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<div class="container cardEdit">
<!-- 			<button id="addFileImg" style="position: fixed;right: 100px;top:80px;display:none;" type="button" class="btn btn-default">+添加媒体</button> -->
<!-- 			<button id="addTextImg" style="position: fixed;right: 100px;top:140px;display:none;" type="button" class="btn btn-default">+添加文本</button> -->
<!-- 			<button id="updateOrderImg" style="position: fixed;right: 100px;top:200px;display:none;" type="button" class="btn btn-default">+重新排序</button> -->
			<div class="container-left">
				<div class="fmt-title">
					上传封面图
				</div>
				<div class="fmt-bg">
					<!-- <div class="fmt-content">
						封面图
					</div> -->
				</div>
				<div class="fmt-cz">
					<div class="fmt-xx fmt-xzys dropdown">
						<div style="cursor:pointer" class="dropdown-toggle" id="dropdownMenu2" data-toggle="dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
							<img src="../../skin/img/xzys.png" />
							<div class="fmt-font">选择颜色</div>
						</div>
						<ul class="dropdown-menu ste-sctp-ul" aria-labelledby="dropdownMenu2">
							<li class="ste-sctp-li">
								<div style="height: 35px;width: 35px;display: inline-block;margin-right: 10px;"></div>
								<div class="ste-sctp-yuan" style="background-color: #A0D468;"></div>
								<div style="height: 35px;width: 35px;display: inline-block;margin-right: 10px;"></div>
								<div style="height: 35px;width: 35px;display: inline-block;margin-right: 10px;"></div>
								<div style="height: 35px;width: 35px;display: inline-block;margin-right: 10px;"></div>
								<div class="ste-sctp-yuan" style="background-color: #FBC94C;"></div>
							</li>
							<li class="ste-sctp-li">
								<div style="height: 35px;width: 35px;display: inline-block;margin-right: 10px;"></div>
								<div class="ste-sctp-yuan" style="background-color: #48CFAD;"></div>
								<div class="ste-sctp-yuan" style="background-color: #4FC1E9;"></div>
								<div style="height: 35px;width: 35px;display: inline-block;margin-right: 10px;"></div>
								<div class="ste-sctp-yuan" style="background-color: #FD6F8B;"></div>
								<div class="ste-sctp-yuan" style="background-color: #F56244;"></div>
							</li>
							<li class="ste-sctp-li">
								<div class="ste-sctp-yuan" style="background-color:#9B9B9B;"></div>
								<div class="ste-sctp-yuan" style="background-color:#028D73;"></div>
								<div class="ste-sctp-yuan" style="background-color:#2480F5;"></div>
								<div class="ste-sctp-yuan" style="background-color:#8478FE;"></div>
								<div class="ste-sctp-yuan" style="background-color:#DA344F;"></div>
								<div style="height: 35px;width: 35px;display: inline-block;margin-right: 10px;"></div>
							</li>
							<li class="ste-sctp-li">
								<div style="height: 35px;width: 35px;display: inline-block;margin-right: 10px;"></div>
								<div style="height: 35px;width: 35px;display: inline-block;margin-right: 10px;"></div>
								<div class="ste-sctp-yuan" style="background-color:#031751;"></div>
								<div class="ste-sctp-yuan" style="background-color:#61246F;"></div>
								<div class="ste-sctp-yuan" style="background-color:#911135;"></div>
								<div class="ste-sctp-yuan" style="background-color:#AB542E;"></div>
							</li>
							<li role="separator" class="divider"></li>
							<li class="ste-sctp-li" style="text-align: center;cursor:pointer;">
								完成
							</li>
						</ul>
					</div>
					<div style="cursor:pointer" class="fmt-xx fmt-sctp dropdown">
						<form id="uploadForm" method="post" enctype="multipart/form-data">
							<input type="file" id="file" name="file" accept="image/*" onchange ="commoncheckfile(this,'uploadForm',uploadFile,'.png,.jpg,.gif',50)" style="display:none;">
						</form>
						<div class="dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
							<img src="../../skin/img/sctp.png" />
							<div class="fmt-font">上传图片</div>
						</div>
						<ul class="dropdown-menu cardUploadBtn" aria-labelledby="dropdownMenu1">
							<li class="uploadBtn">上传</li>
							<li role="separator" class="divider"></li>
							<li class="removeImg">重置</li>
						</ul>
					</div>
				</div>
				<div class="fmt-help">
					<!-- <img src="../../skin/img/edithelp.png" />
					<div class="fmt-font">
						您的更改会自动保存，但只有在单击"完成编辑"之后才能看到
					</div> -->
				</div>
			</div>
			<div class="container-right">
				<form id="cardEditForm">
				<input type="hidden" name="cardColor"/>
				<input type="hidden" name="cardCover"/>
				<div class="mbx-titlebox">
					<div class="row">
						<div class="col-md-8">
							<ul class="mbx">
								<li class="groupNav"></li>
								<li><span class="iconfont icon-right fmt-font"></span></li>
								<li>主题</li>
								<li><span class="iconfont icon-right fmt-font"></span></li>
								<li class="topicNav"></li>
								<li><span class="iconfont icon-right fmt-font"></span></li>
								<li class="cardNav"></li>
							</ul>
						</div>
						<div class="col-md-4 fmt-font mbx-time"></div>
					</div>
					<input type="text" class="form-control srbtinput" maxlength="40" name="cardTitle" placeholder="输入标题在这里......">
				</div>
				</form>
				<!-- <div class="edit-textbox cardItem">
					<input type='hidden' name='cardTextId' value=''/>
					<script id="editor" type="text/plain" style="width: 100%;height: 198px;"></script>
					<div class="edit-delicon" onclick="deleteSelf(this)">
						<span class="iconfont icon-delete"></span>
					</div>
				</div> -->
				<div class="edit-typebox" id="editText">
					<!--文字输入框-->
					<!-- <div class="edit-textbox cardItem">
						<textarea class="form-control editinput"></textarea>
						<div class="edit-delicon" onclick="deleteTextSelf(this)">
							<span class="iconfont icon-delete"></span>
						</div>
					</div> -->
					<!--图片-->
					<!-- <div class="edit-imagebox">
						<img class="edit-image" src="../../skin/img/demoimage.png" />
						<div class="edit-delicon">
							<span class="iconfont icon-delete"></span>
						</div>
					</div> -->
				</div>
				<div style="position: fixed;margin-left: 800px;top:65px;z-index: 9999;">
					<form id="uploadImgForm" method="post" enctype="multipart/form-data">
					<input type="file" id="imgFile" name="file" accept="image/*" onchange ="commoncheckfile(this,'uploadImgForm',uploadImgFile,'.png,.jpg,.gif',50)" style="display:none;">
				</form>
				<form id="addFileForm" method="post" enctype="multipart/form-data">
					<input type="file" id="addFileInput" name="file" accept="application/msword,
					application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,
					application/pdf,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/plain"
					 onchange ="commoncheckfile(this,'addFileForm',addUploadFile,'.doc,.docx,.pdf,.xls,.xlsx,.txt,.ppt,.pptx',50)" style="display:none;">
				</form>
				<form id="addFlashForm" method="post" enctype="multipart/form-data">
					<input type="hidden" name="mediaId"/>
					<input type="hidden" name="resourceId"/>
					<input type="hidden" name="videoTotalTime"/>
					<input type="file" id="addFlash" name="file" accept="audio/mp4, video/mp4" onchange ="commoncheckfile(this,'addFlashForm',addFlashFile,'.mp4',200)" style="display:none;">
				</form>
					<div class="right1 dropdown" id="addFile">
						<img src="../../skin/img/editright1.png" class="dropdown-toggle" id="dropdownMenu3" data-toggle="dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" />
						
						<ul class="dropdown-menu ste-add" aria-labelledby="dropdownMenu3">
							<li onclick="addImg()">
								<span>图片</span>
							</li>
							<li role="separator" class="divider"></li>
							<li onclick="addFile()">
								<span>文档</span>
							</li>
							<li role="separator" class="divider"></li>
							<li onclick="addFlash()">
								<span>视频</span>
							</li>
						</ul>
					</div>
					<div class="right2" id="addText" onclick="addText()" style="cursor:pointer;">
						<img src="../../skin/img/editright2.png"/>				
					</div>
					<div class="right3" id="updateOrder" onclick="updateOrder()" style="cursor:pointer;">
						<img src="../../skin/img/editright3.png" />
					</div>
				</div>
			</div>
		</div>
		<!-- 提示框 -->
		<div class="modal fade" id="msgModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		    <div class="modal-dialog">
		        <div class="modal-content">
		            <div class="modal-body msg"></div>
		            <div class="modal-footer" style="text-align:center;border-top-width: 0px;">
		                <button type="button" class="btn btn-primary confirm" data-dismiss="modal">确定</button>
		            </div>
		        </div><!-- /.modal-content -->
		    </div><!-- /.modal-dialog -->
		</div>
		<!-- 模态框（Modal） -->
		<div class="modal fade" id="cancelModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		    <div class="modal-dialog">
		        <div class="modal-content">
		            <div class="modal-body msg">退出将不会对当前的修改进行保存，是否继续？</div>
		            <div class="modal-footer" style="text-align:center;border-top-width: 0px;">
		                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
		                <button type="button" class="btn btn-primary confirm" onclick="toList(1)">继续</button>
		            </div>
		        </div><!-- /.modal-content -->
		    </div><!-- /.modal-dialog -->
		</div>
		<!-- 排序 -->
		<div class="modal fade" id="changeOrder" tabindex="-1" role="dialog" aria-labelledby="changeOrderModalLabel" aria-hidden="true" data-backdrop="static">
		  <div class="modal-dialog" role="document">
		    <div class="modal-content">
		      <div class="modal-body" style="padding: 10px 15px;overflow-y: auto;height: 500px;">
		      	<div class="cardList">
						<ul id="reorder" class="reorder">
						</ul>
					</div>
					<div style="clear:both;"></div>
		      </div>
		      <div class="modal-footer">
		        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
		        <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="saveOrder()">保存</button>
		      </div>
		    </div>
		  </div>
		</div>
		<div class="bottom-fixed">
			<div class="bottom-body">
				<div class="bottom-btn text-right">
					 <button type="button" class="btn btn-default" onclick="javascript:$('#cancelModal').modal('show');">取消</button>
			         <button type="button" class="btn btn-primary confirm" onclick="updateCard()">保存</button>
				</div>
			</div>
		</div>
		<script type="text/javascript" src="../../plugin/jquery/Sortable.js"></script>
		<script type="text/javascript" src="../../plugin/underscore/underscore-min.js"></script>
		<script type="text/javascript" src="studyTalkEdit.js"></script>
		<script type="text/template" id="editTextTpl">
			<%if(cardTexts.length==0){%>

			<%}else{%>
				<% _.each(cardTexts,function(item,count){%>
					<%if(item.attachId){%>
						<%if(item.attachList&&item.attachList.length>0){%>
						<div class="edit-imagebox cardItem isDocument <%if(item.attachExtName=='ppt'||item.attachExtName=='pptx'){%>h-ppt<%}%>">
							<input type='hidden' name='cardTextId' value='<%=item.cardTextId%>'/>
							<div class="col-lg-12" style="text-align:center;border: 1px solid #ccc;border-radius: 5px;">
							<div class="ck-slide <%if(item.attachExtName=='ppt'||item.attachExtName=='pptx'){%>ppt<%}%>" style="margin:0 auto;overflow: hidden;">
								<ul class="ck-slide-wrapper">
								<%_.each(item.attachList,function(i){%>
									<li <%if(i!=0){%>style="display:none;"<%}%>>
										<img style="cursor:default;" src="../../../components/gtattachment/open/downloadAttachment.json?attachmentId=<%=i.attachid%>">
									</li>
								<%})%>
								</ul>
								<a href="javascript:;" class="ctrl-slide ck-prev">上一张</a> <a href="javascript:;" class="ctrl-slide ck-next">下一张</a>
								<div class="ck-slidebox">
									<div class="slideWrap">
										<span class="imgPage" ></span>
									</div>
								</div>
							</div>
							</div>
							<div class="edit-delicon" onclick="deleteSelf(this)">
								<span class="iconfont icon-delete"></span>
							</div>
							<input type='hidden' name='attachId' value='<%=item.attachId%>'/>
						</div> 
						<%}else if(item.playUrl){%>
						<div class="st-videobox cardItem">
							<input type='hidden' name='cardTextId' value='<%=item.cardTextId%>'/>
							<video id="my-video-<%=item.cardTextId%>" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto" width="670" height="502" poster="../../../components/gtattachment/open/downloadAttachment.json?attachmentId=<%=item.flashImgId%>" data-setup="{}">
								<source src="<%=startUrl%><%=item.playUrl%>" type="video/mp4">
							</video>
							<div class="edit-delicon" onclick="deleteSelf(this)">
								<span class="iconfont icon-delete"></span>
							</div>
							<input type='hidden' name='attachId' value='<%=item.cardTextId%>_video'/>
						</div>
						<%}else{%>
						<div class="box cardItem">
							<input type='hidden' name='cardTextId' value='<%=item.cardTextId%>'/>
							<img class="edit-image" src="../../../components/gtattachment/open/downloadAttachment.json?attachmentId=<%=item.attachId%>" />
							<div class="edit-delicon" onclick="deleteSelf(this)">
								<span class="iconfont icon-delete"></span>
							</div>
							<input type='hidden' name='attachId' value='<%=item.attachId%>'/>
						</div>
						<%}%>
					<%}else if(item.content){%>
						<div class="edit-textbox cardItem">
							<input type='hidden' name='cardTextId' value='<%=item.cardTextId%>'/>
							<textarea class="form-control editinput" id="<%=item.cardTextId%>"><%=item.content%></textarea>
							<div class="edit-delicon" onclick="deleteSelf(this)">
								<span class="iconfont icon-delete"></span>
							</div>
						</div>
					<%}%>
				<%})%>
			<%}%>
		</script>
		<script type="text/template" id="reorderTpl">
			<%if(cardTexts.length==0){%>
				
			<%}else{%>
				<% _.each(cardTexts,function(item,count){%>
						<li class="reorder-item" id="<%=item.cardTextId%>">
						        <div class="lister">
						            <div class="card-list">
										<%if(item.attachId){%>
											<div class="card-img">
											<%if(item.attachList&&item.attachList.length>0){%>
												<img src="../../../components/gtattachment/open/downloadAttachment.json?attachmentId=<%=item.attachList[0].attachid%>"/>
											<%}else if(item.playUrl){%>
												<img src="../../../components/gtattachment/open/downloadAttachment.json?attachmentId=<%=item.flashImgId%>"/>
											<%}else{%>
												<img src="../../../components/gtattachment/open/downloadAttachment.json?attachmentId=<%=item.attachId%>"/>
											<%}%>
					                    	</div>
										<%}else{%>
						                <div class="card-title"><%=item.content%></div>
										<%}%>
						            </div>
						            <div style="clear:both;"></div>
						        </div>
						        <div class="list-add">
						            <div class="add-line">
						                <hr class="dashed"></div>
						        </div>
						    </li>
				<%})%>
			<%}%>
		</script>
	<!-- 遮罩 -->	
	<div class="modal fade" id="loadingModalId" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="z-index:2000;opacity: 0.7;filter: alpha(opacity=70);background: #fff;"> 
     		<div class="modal-dialog" style="width:300px;position:absolute;top:30%;left:40%;">
         	<div id="gzLoading" class="gzLoading">加载中...</div>
     </div>
 </div>
	</body>

</html>